///审批部门信息管理

var licensingAuthorityMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'ID',
    sort: false
  }, {
    show: true,
    lable: 'DEPTNAME',
    fieldname: 'dept_name',//
    sort: false
  }, {
    show: true,
    lable: 'TELEPHONE',
    fieldname: 'telephone',//
    sort: false
  },],
  //查询键值
  searchKey: [{
    fieldname: 'dept_name',
    lable: 'DEPTNAME',
    type: 'select',
    data: [],
    value: '',
    cpp_type: 'string'
  }]
}

var licensingAuthorityFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: false,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
}, {
  type: 'input',
  data: [],
  label: 'DEPTNAME',
  fieldname: 'dept_name',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'TELEPHONE',
  fieldname: 'telephone',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
},
  {
    type: 'editor',
    data: [],
    label: 'DEPTCONTENT',
    fieldname: 'content',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }]

///区县人才办信息管理

var talentOfficeMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'ID',
    sort: false
  }, {
    show: true,
    lable: 'DISTNAME',
    fieldname: 'dist_name',//
    sort: false
  }, {
    show: true,
    lable: 'TELEPHONE',
    fieldname: 'telephone',//
    sort: false
  },],
  //查询键值
  searchKey: [{
    fieldname: 'dist_name',
    lable: 'DISTNAME',
    type: 'select',
    data: [],
    value: '',
    cpp_type: 'string'
  }]
}

var talentOfficeFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: false,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
}, {
  type: 'input',
  data: [],
  label: 'DISTNAME',
  fieldname: 'dist_name',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'TELEPHONE',
  fieldname: 'telephone',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
},
  {
    type: 'editor',
    data: [],
    label: 'DISTCONTENT',
    fieldname: 'content',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }]

//专业技术人员信息管理
var informationManagementMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'ID',
    sort: false
  }, {
    show: true,
    lable: 'NAME',
    fieldname: 'real_name',//
    sort: false
  }, {
    show: true,
    lable: 'SEX',
    fieldname: 'sex',//
    sort: false
  }, {
    show: true,
    lable: 'TITLESNAME',
    fieldname: 'tech_titles_name',//
    sort: false
  }, {
    show: true,
    lable: 'UNIT',
    fieldname: 'unit',//
    sort: false
  },],
  //查询键值
  searchKey: [{
    fieldname: 'real_name',
    lable: 'NAME',
    type: 'select',
    data: [],
    value: '',
    cpp_type: 'string'
  }]
}

var informationManagementFormMap = {
  left: [{
    type: 'input',
    data: [],
    label: 'ID',
    fieldname: 'id',
    value: '',
    show: false,
    required: false, //是否必填
    disabled: true, //是否禁用
    cpp_type: 'int', //类型
  }, {
    type: 'input',
    data: [],
    label: 'NAME',
    fieldname: 'real_name',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'input',
    data: [],
    label: 'TITLESNAME',
    fieldname: 'tech_title_id',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'input',
    data: [],
    label: 'REPORTUNIT',
    fieldname: 'report_unit',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'input',
    data: [],
    label: 'HLHR_UNIT_AREA',
    fieldname: 'unit_area_id',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'date-picker',
    data: [],
    label: 'REPORTTIME',
    fieldname: 'report_time',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'input',
    data: [],
    label: 'PRIORITY',
    fieldname: 'priority',
    value: '',
    show: true,
    required: false,
    disabled: false,
    cpp_type: 'string',
  }],
  right: [{
    type: 'select',
    data: [],
    label: 'SEX',
    fieldname: 'sex',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'select',
    data: [],
    label: 'TITLECLASS',
    fieldname: 'tech_title_class_id',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'input',
    data: [],
    label: 'UNIT',
    fieldname: 'unit',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'select',
    data: [],
    label: 'UNITCHARACTER',
    fieldname: 'unit_character',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'select',
    data: [],
    label: 'END_EDUCATION',
    fieldname: 'end_education',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'input',
    data: [],
    label: 'LINKMAN',
    fieldname: 'link_man',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'input',
    data: [],
    label: 'paperwork',
    fieldname: 'paperwork',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }]
}

//单位所在区域
var expertCategoryMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'ID',
    sort: false
  }, {
    show: true,
    lable: 'CLASSNAME',
    fieldname: 'expert_class_name',//职称名
    sort: false
  },],
  //查询键值
  searchKey: [{
    fieldname: 'expert_class_name',
    lable: 'CLASSNAME',
    type: 'select',
    data: [],
    value: '',
    cpp_type: 'string'
  }]
}

var expertCategoryFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: false,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
}, {
  type: 'input',
  data: [],
  label: 'CLASSNAME',
  fieldname: 'expert_class_name',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'ENAME',
  fieldname: 'expert_class_ename',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}]

//单位所在区域
var unitAreaMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'ID',
    sort: false
  }, {
    show: true,
    lable: 'UNITAREANAME',
    fieldname: 'unit_area_name',//职称名
    sort: false
  },],
  //查询键值
  searchKey: [{
    fieldname: 'unit_area_name',
    lable: 'UNITAREANAME',
    type: 'select',
    data: [],
    value: '',
    cpp_type: 'string'
  }]
}

var unitAreaFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: false,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
}, {
  type: 'input',
  data: [],
  label: 'UNITAREANAME',
  fieldname: 'unit_area_name',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'ENAME',
  fieldname: 'unit_area_ename',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}]

//职称
var titlesNameMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'ID',
    sort: false
  }, {
    show: false, //是否显示
    lable: 'TITLE_CLASS_ID',
    fieldname: 'title_class_id',
    sort: false
  }, {
    show: true,
    lable: 'TITLESNAME',
    fieldname: 'tech_titles_name',//职称名
    sort: false
  }, {
    show: true,
    lable: 'TITLESLEVEL',
    fieldname: 'tech_titles_level',
    sort: false
  }],
  //查询键值
  searchKey: [{
    fieldname: 'tech_titles_name',
    lable: 'TITLESNAME',
    type: 'select',
    data: [],
    value: '',
    cpp_type: 'string'
  }]
}

var titlesNameFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: false,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
}, {
  type: 'input',
  data: [],
  label: 'TITLESNAME',
  fieldname: 'tech_titles_name',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'ENAME',
  fieldname: 'tech_titles_ename',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'TITLESLEVEL',
  fieldname: 'tech_titles_level',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'TITLESLEVEL',
  fieldname: 'tech_titles_elevel',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'select',
  data: [],
  label: 'TITLECLASS',
  fieldname: 'tech_titles_class_id',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}]

//职称分类
var titleclassMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'ID',
    sort: false
  }, {
    show: true,
    lable: 'TITLECLASSNAME',
    fieldname: 'tech_titles_class_name',
    sort: false
  },],
  //查询键值
  searchKey: [{
    fieldname: 'tech_titles_class_name',
    lable: 'TITLECLASSNAME',
    type: 'select',
    data: [],
    value: '',
    cpp_type: 'string'
  }]
}

var titleclassFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: false,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
}, {
  type: 'input',
  data: [],
  label: 'TITLECLASSNAME',
  fieldname: 'tech_titles_class_name',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'ENAME',
  fieldname: 'tech_titles_class_ename',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}]

//服务类型管理
var reservationMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'id',
    sort: false
  }, {
    show: true,
    lable: 'SERVICETYPENAME',
    fieldname: 'service_name',
    sort: false
  }, {
    show: true,
    lable: 'HEAT_LEVER',
    fieldname: 'heat_lever',
    sort: false
  },
    {
      show: true,
      lable: 'STATE',
      fieldname: 'state',
      sort: false
    },
  ],
  //查询键值
  searchKey: [{
    fieldname: 'service_name',
    lable: 'SERVICETYPENAME',
    type: 'select',
    data: [],
    datasource: 'RESERVATION_TYPE_LISTALL',//查询所有数据的映射字段
    value: '',
    cpp_type: 'string'
  }]
}

var reservationFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: true,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
},
  {
    type: 'input',
    data: [],
    label: 'SERVICETYPENAME',
    fieldname: 'service_name',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  },
  {
    type: 'input',
    data: [],
    label: 'SERVICETYPEENAME',
    fieldname: 'service_ename',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'select',
    data: [{'ID': '1', 'name': '启用'}, {'ID': '0', 'name': '不启用'}],
    label: 'STATE',
    fieldname: 'state',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  },
  {
    type: 'input',
    data: [],
    label: 'HEAT_LEVER',
    fieldname: 'heat_lever',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  },
]

//操作类型管理
var opertypeMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'id',
    sort: false
  }, {
    show: true,
    lable: 'SYSNAME',
    fieldname: 'subsys_name',
    sort: false
  }, {
    show: true,
    lable: 'OPERTYPENAME',
    fieldname: 'opertype_name',
    sort: false
  },
    {
      show: true,
      lable: 'OPERTYPECODE',
      fieldname: 'opertype_code',
      sort: false
    }],
  //查询键值
  searchKey: [{
    fieldname: 'subsys_name',
    lable: 'SYSNAME',
    type: 'select',
    data: [],
    path: 'SUBSYS_LISTALL',//查询所有数据的映射字段
    value: '',
    cpp_type: 'string'
  }]
}

var opertypeFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: true,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
},
  {
    type: 'input',
    data: [],
    label: 'SYSID',
    fieldname: 'subsys_id',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  },
  {
    type: 'select',
    data: [],
    label: 'SYSNAME',
    fieldname: 'subsys_name',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'input',
    data: [],
    label: 'OPERTYPENAME',
    fieldname: 'opertype_name',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  },
  {
    type: 'input',
    data: [],
    label: 'OPERTYPECODE',
    fieldname: 'opertype_code',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }]

//角色管理
var roleMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'ID',
    sort: false
  }, {
    show: true,
    lable: 'SYSNAME',
    fieldname: 'subsys_name',
    sort: false
  }, {
    show: true,
    lable: 'ROLENAME',
    fieldname: 'role_name',
    sort: false
  }],
  //查询键值
  searchKey: [{
    fieldname: 'role_name',
    lable: 'ROLENAME',
    type: 'select',
    data: [],
    path: 'ROLE_LISTALL',//查询所有数据的映射字段
    value: '',
    cpp_type: 'string'
  }]
}
var roleFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: true,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
},
  {
    type: 'input',
    data: [],
    label: 'SYSID',
    fieldname: 'subsys_id',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  },
  {
    type: 'select',
    data: [],
    label: 'SYSNAME',
    fieldname: 'subsys_name',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }, {
    type: 'input',
    data: [],
    label: 'ROLENAME',
    fieldname: 'role_name',
    value: '',
    show: true,
    required: true,
    disabled: false,
    cpp_type: 'string',
  }]

//子系统
var subSystemMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'ID',
    sort: false
  }, {
    show: true,
    lable: 'SYSNAME',
    fieldname: 'subsys_name',
    sort: false
  },],
  //查询键值
  searchKey: [{
    fieldname: 'SYSNAME',
    lable: 'SYSNAME',
    type: 'select',
    data: [],
    value: '',
    path: 'SUBSYS_LISTALL',//查询所有数据的映射字段
    cpp_type: 'string'
  }]
}

var subSystemFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: false,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
}, {
  type: 'input',
  data: [],
  label: 'SYSNAME',
  fieldname: 'subsys_name',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'SYSENGLISHNAME',
  fieldname: 'subsys_ename',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'SUBSYS_URL',
  fieldname: 'subsys_url',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}]

//行业序列
var vocationMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'ID',
    sort: false
  }, {
    show: true,
    lable: 'VOCATION',
    fieldname: 'vocation_name',
    sort: false
  },],
  //查询键值
  searchKey: [{
    fieldname: 'vocation_name',
    lable: 'VOCATION',
    type: 'select',
    data: [],
    value: '',
    cpp_type: 'string'
  }]
}
var vocationFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: false,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
}, {
  type: 'input',
  data: [],
  label: 'VOCATION',
  fieldname: 'vocation_name',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'ENAME',
  fieldname: 'vocation_ename',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}]

//外国专家类别
var foreignExpertClassMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'ID',
    sort: false
  }, {
    show: true,
    lable: 'CLASSNAME',
    fieldname: 'foreign_expert_class_name',
    sort: false
  },],
  //查询键值
  searchKey: [{
    fieldname: 'foreign_expert_class_name',
    lable: 'CLASSNAME',
    type: 'select',
    data: [],
    value: '',
    cpp_type: 'string'
  }]
}
var foreignExpertClassFormMap = [{
  type: 'input',
  data: [],
  label: 'ID',
  fieldname: 'id',
  value: '',
  show: false,
  required: false, //是否必填
  disabled: true, //是否禁用
  cpp_type: 'int', //类型
}, {
  type: 'input',
  data: [],
  label: 'CLASSNAME',
  fieldname: 'foreign_expert_class_name',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}, {
  type: 'input',
  data: [],
  label: 'ENAME',
  fieldname: 'foreign_expert_class_ename',
  value: '',
  show: true,
  required: true,
  disabled: false,
  cpp_type: 'string',
}]

//外国专家信息管理
var foreignTechnicistMapData = {
  //表头信息
  tableHeadKey: [{
    show: false, //是否显示
    lable: 'ID',
    fieldname: 'foreign_technicist_id',
    sort: false
  }, {
    show: true,
    lable: 'NAME',//姓名
    fieldname: 'link_man',
    sort: false
  }, {
    show: true,
    lable: 'SEX',//性别
    fieldname: 'sex',
    sort: false
  }, {
    show: true,
    lable: 'NATIONALITY',//国籍
    fieldname: 'nationality_id',
    sort: false
  }, {
    show: true,
    lable: 'INTRODUCEUNIT',//引进单位
    fieldname: 'introduce_unit',
    sort: false
  }, {
    show: true,
    lable: 'REPORTUNIT',//填报单位
    fieldname: 'report_unit',
    sort: false
  }, {
    show: true,
    lable: 'ISVERIFY',//审核状态
    fieldname: 'verify',
    sort: false
  }],
  //查询键值
  searchKey: [{
    fieldname: 'nationality_id',
    lable: 'NATIONALITY',
    type: 'select',
    data: [],
    value: '',
    cpp_type: 'string'
  }]
}
var foreignTechnicistFormMap =
  {
    left: [{
      type: 'input',
      data: [],
      label: 'ID',
      fieldname: 'id',
      value: '',
      show: false,
      required: false, //是否必填
      disabled: true, //是否禁用
      cpp_type: 'int', //类型
    }, {
      type: 'input',
      data: [],
      label: 'NAME',
      fieldname: 'link_man',
      value: '',
      show: true,
      required: true, //是否必填
      disabled: false, //是否禁用
      cpp_type: 'int', //类型
    }, {
      type: 'input',
      data: [],
      label: 'NATIONALITY',
      fieldname: 'nationality_id',
      value: '',
      show: true,
      required: true, //是否必填
      disabled: false, //是否禁用
      cpp_type: 'int', //类型
    }],
    right: [{
      type: 'input',
      data: [],
      label: 'SEX',
      fieldname: 'sex',
      value: '',
      show: true,
      required: true, //是否必填
      disabled: false, //是否禁用
      cpp_type: 'int', //类型
    }, {
      type: 'input',
      data: [],
      label: 'INTRODUCEUNIT',
      fieldname: 'introduce_unit',
      value: '',
      show: true,
      required: true, //是否必填
      disabled: false, //是否禁用
      cpp_type: 'int', //类型
    }]
  }

//add功能按钮
var addToolbarType = [{
  type: 'primary',
  icon: 'check',
  msg: 'Save',
  event: 'save'
}, {
  type: 'primary',
  icon: 'plus',
  msg: 'Verify',
  event: 'verify'
}, {
  type: 'primary',
  icon: 'plus',
  msg: 'Abandonment',
  event: 'unverify'
}, {
  type: 'primary',
  icon: 'delete',
  msg: 'Delete',
  event: 'delete'
}, {
  type: 'primary',
  icon: 'check',
  msg: 'Print',
  event: 'print'
}]

//list页面的功能按钮
var listToolbarType = [{
  type: 'primary',
  icon: 'plus',
  msg: 'Plus',
  event: 'add',
  name: '新增'
}, {
  type: 'primary',
  icon: 'edit',
  msg: 'Edit',
  event: 'edit',
  name: '编辑'
}, {
  type: 'primary',
  icon: 'delete',
  msg: 'Delete',
  event: 'delete',
  name: '删除'
},
]

var ComboBoxDataMap = {
  role_name: {
    key: 'role_name',
    valueField: 'id',
    textField: 'role_name',
    datasource: 'ROLE_LISTALL'
  },
  subsys_name: {
    key: 'subsys_name',
    valueField: 'id',//listall时获取的id名称
    textField: 'subsys_name',
    datasource: 'SUBSYS_LISTALL',
    serverField: 'subsys_id',//对应发送到服务器的ID号码
  },
  service_name: {
    key: 'service_name',
    valueField: 'id',//listall时获取的id名称
    textField: 'service_name',
    datasource: 'RESERVATION_TYPE_LISTALL',
    serverField: 'id',//对应发送到服务器的ID号码
  },
  vocation_name: {
    key: 'vocation_name',
    valueField: 'vocation_name',//listall时获取的id名称
    textField: 'vocation_name',
    datasource: 'HLHR_VOCATION_LISTALL'
  },
  foreign_expert_class_name: {
    key: 'foreign_expert_class_name',
    valueField: 'foreign_expert_class_name',//listall时获取的id名称
    textField: 'foreign_expert_class_name',
    datasource: 'HLHR_FOREIGN_EXPERT_CLASS_LISTALL'
  },
  foreign_expert_id: {
    key: 'foreign_expert_id',//外国专家
    valueField: 'foreign_expert_class_name',//listall时获取的id名称
    textField: 'foreign_expert_class_name',
    datasource: 'HLHR_FOREIGN_EXPERT_CLASS_LISTALL'
  },
  tech_titles_class_id: {
    key: 'tech_titles_class_id',
    valueField: 'id',//listall时获取的id名称
    textField: 'tech_titles_class_name',
    datasource: 'TECHTITLE_CLASS_LISTALL'
  },
  tech_title_class_id: {
    key: 'tech_title_class_id',
    valueField: 'id',//listall时获取的id名称
    textField: 'tech_titles_class_name',
    datasource: 'TECHTITLE_CLASS_LISTALL'
  },
  expert_class_id: {
    key: 'expert_class_id',
    valueField: 'id',//listall时获取的id名称
    textField: 'expert_class_name',
    datasource: 'HLHR_EXPERT_CLASS_LISTALL'
  },
  report_unit: {
    key: 'report_unit',
    valueField: 'id',//listall时获取的id名称
    textField: 'unit_area_name',
    datasource: 'HLHR_UNIT_AREA_LISTALL'
  },
  unit_area_id: {
    key: 'unit_area_id',
    valueField: 'id',//listall时获取的id名称
    textField: 'unit_area_name',
    datasource: 'HLHR_UNIT_AREA_LISTALL'
  },
  tech_title_id: {
    key: 'tech_title_id',	//
    valueField: 'id',
    textField: 'tech_titles_name',
    datasource: 'HLHR_TECHTITLE_TITLE_LISTALLL',
  },
  tech_title: {
    key: 'tech_title',	//
    valueField: 'id',
    textField: 'tech_titles_name',
    datasource: 'HLHR_TECHTITLE_TITLE_LISTALLL',
  },
  nationality_id: {
    key: 'nationality_id',	//国籍
    valueField: 'id',
    textField: 'nationality_cname',
    datasource: 'NATIONALITY_LISTALL',
  },
  native_places: {
    key: 'native_places',
    valueField: 'value',
    textField: 'label',
    datasource: 'PROVINCE_LISTCASCADE',
  },
  livings: {
    key: 'livings',
    valueField: 'value',
    textField: 'label',
    datasource: 'PROVINCE_LISTCASCADE',
  },
  sex: {
    key: 'sex',
    valueField: 'value',
    textField: 'label',
    datasource: 'local',//local表示在本地GlobeDefine查找
    define: 'sex'//表示向GlobeDefine里查找列表时传入的参数
  },
  unit_character: {
    key: 'unit_character',
    valueField: 'value',
    textField: 'label',
    datasource: 'local',//local表示在本地GlobeDefine查找
    define: 'unit_character'//表示向GlobeDefine里查找列表时传入的参数
  },
  end_education: {
    key: 'end_education',
    valueField: 'value',
    textField: 'label',
    datasource: 'local',//local表示在本地GlobeDefine查找
    define: 'education'//表示向GlobeDefine里查找列表时传入的参数
  },
  edu_degree: {
    key: 'edu_degree',
    valueField: 'value',
    textField: 'label',
    datasource: 'local',//local表示在本地GlobeDefine查找
    define: 'education_degree'//表示向GlobeDefine里查找列表时传入的参数
  },
  political: {
    key: 'political',	//政治面貌
    valueField: 'value',
    textField: 'label',
    datasource: 'local',//local表示在本地GlobeDefine查找
    define: 'political'//表示向GlobeDefine里查找列表时传入的参数
  },
  marriage: {
    key: 'marriage',	//
    valueField: 'value',
    textField: 'label',
    datasource: 'local',//local表示在本地GlobeDefine查找
    define: 'marriage'//表示向GlobeDefine里查找列表时传入的参数
  },
  job_level: {
    key: 'job_level',	//
    valueField: 'value',
    textField: 'label',
    datasource: 'local',
    define: 'job_level'
  },
  families: {
    key: 'families',	//家属
    valueField: 'value',
    textField: 'label',
    datasource: 'local',
    define: 'families'
  },
  is_four_class: {
    key: 'is_four_class',	//是否属于四类专家
    valueField: 'value',
    textField: 'label',
    datasource: 'local',
    define: 'bool'
  },
  company_size: {
    key: 'company_size',	//公司规模
    valueField: 'value',
    textField: 'label',
    datasource: 'local',
    define: 'company_size'
  },
  company_type: {
    key: 'company_type',	//公司类型
    valueField: 'value',
    textField: 'label',
    datasource: 'local',
    define: 'company_type'
  },
  dist_name: {
    key: 'dist_name',	//
    valueField: 'id',
    textField: 'dist_name',
    datasource: 'TALENTS_OFFICE_LIST',
  },
  dept_name:
    {
      key: 'dept_name',	//
      valueField: 'id',
      textField: 'dept_name',
      datasource: 'LICENSING_AUTHORITY_LIST',
    },
  academic_requirements: {
    key: 'academic_requirements',
    valueField: 'value',
    textField: 'label',
    datasource: 'local',
    define: 'academic_requirements'
  },
  work_experience: {
    key: 'work_experience',
    valueField: 'value',
    textField: 'label',
    datasource: 'local',
    define: 'work_experience'
  },
  recruitment_type: {
    key: 'recruitment_type',
    valueField: 'value',
    textField: 'label',
    datasource: 'local',
    define: 'recruitment_type'
  }
}

export function getComboBoxMap (searchkey) {

  return ComboBoxDataMap[searchkey]
}

/**
 * 返回表格的表头字段字段
 * @param  {[String]} 表格类型（如内部商品，销售订单）
 * @param  {[String]} 获取数据的类型（如表头数据，查询键值）
 * @return {[Array]} 你需要的数据以数组的形式返回
 */
export function getTableHeadData (type, key) {
  var _data = new Array()
  switch (type) {
    case 'SUBSYS':
      _data = subSystemMapData[key]
      break
    case 'ROLE':
      _data = roleMapData[key]
      break
    case 'OPERTYPE':
      _data = opertypeMapData[key]
      break
    case 'RESERVATION_TYPE':
      _data = reservationMapData[key]
      break
    case 'TECHTITLE_CLASS':
      _data = titleclassMapData[key]
      break
    case 'HLHR_TECHTITLE_TITLE':
      _data = titlesNameMapData[key]
      break
    case 'HLHR_UNIT_AREA':
      _data = unitAreaMapData[key]
      break
    case 'HLHR_EXPERT_CLASS':
      _data = expertCategoryMapData[key]
      break
    case 'HLHR_TECHNICIST':
      _data = informationManagementMapData[key]
      break
    case 'HLHR_VOCATION':
      _data = vocationMapData[key]
      break
    case 'HLHR_FOREIGN_EXPERT_CLASS':
      _data = foreignExpertClassMapData[key]
      break
    case 'HLHR_FOREIGN_TECHNICIST':
      _data = foreignTechnicistMapData[key]
      break
    case 'TALENTS_OFFICE':
      _data = talentOfficeMapData[key]
      break
    case 'LICENSING_AUTHORITY':
      _data = licensingAuthorityMapData[key]
      break
    default:
      break
  }
  return _data
}

/**
 * 对表格显示的数据进行格式化
 * @param  {Object} row    每一行的数据
 * @param  {Object} column 每一列的描述
 * @return {String}        格式化的数据
 */
export function tableCommonFormatter (row, column) {
  if (column.property === 'verify') {
    if (row.verify === 1) {
      return '审核通过'
    } else {
      return '审核失败'
    }
  }
  if (column.property === 'sex') {
    if (row.sex === 0) {
      return '男'
    } else {
      return '女'
    }
  }
  return row[column.property]
}

/**
 * 取得dialog的数据映射
 * @param  {Object} src  从list页面传来的row
 * @param  {String} type list页面的种类
 * @return {Object}      映射后的数据
 */
export function getDialogFormMap (src, type) {
  var target
  switch (type) {
    case 'SUBSYS':
      target = subSystemFormMap
      break
    case 'ROLE':
      target = roleFormMap
      break
    case 'OPERTYPE':
      target = opertypeFormMap
      break
    case 'RESERVATION_TYPE':
      target = reservationFormMap
      break
    case 'TECHTITLE_CLASS':
      target = titleclassFormMap
      break
    case 'HLHR_TECHTITLE_TITLE':
      target = titlesNameFormMap
      break
    case 'HLHR_UNIT_AREA':
      target = unitAreaFormMap
      break
    case 'HLHR_EXPERT_CLASS':
      target = expertCategoryFormMap
      break
    case 'HLHR_TECHNICIST':
      target = informationManagementFormMap
      break
    case 'HLHR_VOCATION':
      target = vocationFormMap
      break
    case 'HLHR_FOREIGN_EXPERT_CLASS':
      target = foreignExpertClassFormMap
      break
    case 'HLHR_FOREIGN_TECHNICIST':
      target = foreignTechnicistFormMap
      break
    case 'TALENTS_OFFICE':
      target = talentOfficeFormMap
      break
    case 'LICENSING_AUTHORITY':
      target = licensingAuthorityFormMap
      break
    default:
      break
  }
  var i = 0
  var len = target.length
  for (i = 0; i < len; i++) {
    target[i].value = src[target[i].fieldname]
  }
  return target
}

/**
 * 根据权限和页面类型获取功能按钮
 * @param  {String} type      页面类型如list，add
 * @param  {Int} authority  用户的权限
 * @return {Array}           返回功能按钮的信息
 */
export function getToolBarList (type, authority) {
  var s = 0
  var toolbar = new Array()
  var toolbarList = new Array()
  switch (type) {
    case 'add':
      toolbarList = addToolbarType
      break
    case 'list':
      toolbarList = listToolbarType
      break
    default:
      toolbarList = addToolbarType
      break
  }
  var len = toolbarList.length
  var i = 0
  for (i = 0; i < len; i++) {
    s = authority & (1 << i)
    if (s != 0) {
      toolbar.push(toolbarList[i])
    }
  }
  return toolbar
}

/**
 * 将数据源映射成需要的表单结构的数据
 * @param  {Array} arr       数据源
 * @param  {String} fieldname 数据源中表单字段的键
 * @param  {String} value     数据源中表单内容的键
 * @return {Object}           映射成的表单
 */
export function getObjectDataFromArray (arr, key, value) {
  var data = new Object()
  var _key = ''
  var _value = ''
  arr.forEach(function (element, index) {
    _key = element[key]
    _value = element[value]
    data[_key] = _value
  })
  return data
}
